<template>
  <el-container direction='vertical'>
    <v-header :title='title' :shop='shop'></v-header>
    <router-view/>
  </el-container>
  <!-- <div id="base">
  </div> -->
</template>
<script>
// import api from '@/API/index'
import VHeader from './header/header'

export default {
  name: 'bsae',
  props: {},
  data() {
    return {
      title: this.$t('base.title'),
      shop: {
        name: '',
        avatar: '',
        shopId: ''
      }
    }
  },
  methods: {
    checkToken() {
      this.$store.dispatch('checkToken').then((data) => {
        if (data.status === 200) {
          if (this.$route.path === '/') {
            this.$router.replace('/manage/goods')
          } else {
            if (data.data.shop.checked === 2) {
              this.$notify({
                title: 'Prompt',
                type: 'warning',
                message: this.$t('base.check')
              })
            }
          }
        }
      })
    }
  },
  created() {
    this.checkToken()
  },
  mounted() {},
  computed: {},
  components: {
    'v-header': VHeader
  }
}
</script>

<style lang="less" scoped>
@import 'base.less';
.el-container {
  // flex-direction: column;
  height: 100%;
}
</style>
